const KoaRouter = require('koa-router')
const {
  sleep,
  readFlieOfBase,
  readFlieOfBlod,
  readFlieOfSplit,
  mergeFile,
  writeFile
} = require('../middleware/index.js')
const router = new KoaRouter()
router.get('/', ctx => {
  ctx.body = "如果您看到这个页面，说明已经启动成功啦(#^.^#)~"
})
router.post('/updateFile', sleep, readFlieOfBlod, writeFile)
router.post('/updateFileBase', sleep, readFlieOfBase, writeFile)
router.post('/updateFileSplit', sleep, readFlieOfSplit)
router.get('/mergeFile', sleep, mergeFile)
module.exports = router